Introduce verification-doc component with 4 states - #892
Conversation
c33dba4 to
a7d714f
Compare
joshsmith
left a comment
There was a problem hiding this comment.
Couple quick comments, but otherwise looking good!
| we need you to upload a scan of your ID (form + submit) | ||
| {{else if (eq stripleConnectAccount.verification_document_status 'verifying')}} | ||
| Please be patient while we review the document you provided. | ||
| {{else if (eq stripleConnectAccount.verification_document_status 'verified')}} |
There was a problem hiding this comment.
Just a small typo here stripleConnectAccount
There was a problem hiding this comment.
I would just do if (eq stripleConnectAccount.verification_document_status 'required') and if (eq stripleConnectAccount.verification_document_status 'verifying') without the branching. Otherwise, it will by default render nothing.
There was a problem hiding this comment.
mm, didn't quite understand; why would it render nothing @joshsmith?
There was a problem hiding this comment.
@sarupbanskota I'm saying we only want to handle the two cases of required and verifying. No need to branch then with your conditionals. This component renders something only in those two cases.
| {{/payments/funds-recipient/verification-document}} | ||
| `); | ||
|
|
||
| assert.equal(this.$().text().trim(), 'template block text'); |
There was a problem hiding this comment.
You'll need to introduce a new page object for these tests, when you get there.
There was a problem hiding this comment.
sure, could you point me to an example on another test file?
There was a problem hiding this comment.
Sure, the bank-account-test which is a sister component is a good example.
a7d714f to
67238dd
Compare
|
@sarupbanskota Good job up to this point. I'll take over and try to wrap up before you're back. |
|
This checks all the boxes now, but there are some notes that I would like to add:
Either way, the process here does work. It will upload the file to stripe, then pass out the action with a stripe id parameter all the way to the route, where the route will assign it to the connect account and try to save that connect account. This fails right now, because the API has no such endpoint, but all the failure points that I could think of are handled in a basic way - by rendering a friendly error. The errors rendered are:
|
joshsmith
left a comment
There was a problem hiding this comment.
I'm pretty okay not testing the internals of the addon. What's here looks generally good enough to me!
| */ | ||
| additionalUploadData: { | ||
| // required to authorize the upload request | ||
| key: ENV.stripe.publishableKey, |
There was a problem hiding this comment.
This actually works? I only saw the basic auth header in the docs.
There was a problem hiding this comment.
I couldn't find that part at all. Only found this one.
|
It's not just that we aren't testing internals. The addon doesn't allow much in appearance stuff, so we have to basically wrap it up into an external addon, which handles the event hooks. That external addon would then be the one that displays progress/errors/etc., so we ought to test that one to ensure all of the features work. I'm not sure how, though. In an integration test, we would have to mock a web request (to upload), which sends a progress report, as well as mocking file selection. In a unit test, those things could be mocked by calling the handlers manually, but then we aren't testing the whole surface area. That being said, I think it should be mergeable as is, but we need to create an issue to figure that out later. |
sarupbanskota
left a comment
There was a problem hiding this comment.
Learned a bunch of things just checking out your progress on this PR 😍
Thank you! I'll PM you with some general questions I have
|
Haven't had a chance to code review but there are some conflicts that need resolving now. Would prefer keeping the |
|
I might be able to fix these changes when I get home this evening. |
0cdee65 to
a8aaa88
Compare
|
This should be good to go now. |
a8aaa88 to
bef0e0a
Compare
joshsmith
left a comment
There was a problem hiding this comment.
Just minor things would change, otherwise looks good.
| } | ||
| }, | ||
|
|
||
| _validate({ type, size }) { |
There was a problem hiding this comment.
Would alpha order these.
| _handleIdentityVerificationDocumentError() { | ||
| let friendlyError = new FriendlyError(VERIFICATION_DOCUMENT_ERROR); | ||
| return RSVP.reject(friendlyError); | ||
| }, |
There was a problem hiding this comment.
Would also alpha-order here.
bef0e0a to
8533b4b
Compare
Progress on: #885
In the
identity-document-file-uploadcomponent we'll:https://uploads.stripe.com/v1/filesparamNametofilepurposeparam with value of"identity_document"Stripe-Accountheader to accept thestripeConnectAccount.idFromStripeBasicauth header to have a username of ourENV.stripe.publishableKeywith no password – this probably needs to be base64 encoded (e.g.pk_test_123:would be encoded)Ideally we should:
When the upload is finished, we'll need to:
idvalue found in the response in an action to theverification-documentcomponentverification-documentcomponent will then call an action to set theidentityDocumentIdfield on theStripeConnectAccountmodel